package api

const (
	Port = ":9001"

	// 图片模块路由
	GetUpLoadPassPath       = "/getUpLoadPass"
	SaveImgPath             = "/saveImg"
	GetImgsByAccountPath    = "/getImgsByAccount"
	GetImgsByCategoryIdPath = "/getImgsByCategoryId"
	RemoveImgsPath          = "/removeImgs"
	GetImageShareListPath   = "/getImageShareList"
	RemoveImageSharePath    = "/removeImageShare"
	SaveImageSharePath      = "/saveImageShare"
	UpdateImgCategoryIdPath = "/updateImgCategoryId"
	GetImgsByShareIdPath    = "/getImgsByShareId"

	// 用户模块路由
	LoginPath          = "/login"
	RegisterPath       = "/register"
	UpdateUserPath     = "/updateUser"
	GetUserByTokenPath = "/getUserByToken"
	GetCaptchaPath     = "/getCaptcha"
	VerifyCaptchaPath  = "/verifyCaptcha"

	// 热搜查询模块路由
	GetHotsByWordPath = "/getHot/byWord"
	GetHotsByTimePath = "/getHot/byTime"

	// 图片分类模块路由
	GetCategoriesByAccountPath = "/getCategoriesByAccount"
	SaveCategoryPath           = "/saveCategory"
	RemoveCategoryPath         = "/removeCategory"

	// 聊天室
	GetChatRoomsPath    = "/getChatRooms"
	GetChatRoomByIdPath = "/getChatRoomById"
	CreateChatRoomPath  = "/createChatRoom"
	RemoveChatRoomPath  = "/removeChatRoom"
	WsChatRoomPath      = "/wsChatRoom"
)

var (
	// ExcludePaths 不进行token验证的接口
	ExcludePaths = []string{LoginPath, RegisterPath, GetImgsByShareIdPath, GetCaptchaPath, VerifyCaptchaPath, WsChatRoomPath}
	// FrequencyLimitExcludePaths 不进行频率限制的接口
	FrequencyLimitExcludePaths = []string{GetUpLoadPassPath, SaveImgPath, WsChatRoomPath}

	ApiAccess = map[string][]int{
		// 图片模块路由
		GetUpLoadPassPath:       {1, 2},
		SaveImgPath:             {1, 2},
		GetImgsByAccountPath:    {1, 2},
		GetImgsByCategoryIdPath: {1, 2},
		RemoveImgsPath:          {1, 2},
		GetImageShareListPath:   {1, 2},
		RemoveImageSharePath:    {1, 2},
		SaveImageSharePath:      {1, 2},
		UpdateImgCategoryIdPath: {1, 2},
		GetImgsByShareIdPath:    {1, 2},
		GetCaptchaPath:          {1, 2},
		VerifyCaptchaPath:       {1, 2},

		// 用户模块路由
		LoginPath:          {1, 2},
		RegisterPath:       {1, 2},
		UpdateUserPath:     {1, 2},
		GetUserByTokenPath: {1, 2},

		// 微博热搜查询模块路由
		GetHotsByWordPath: {1, 2},
		GetHotsByTimePath: {1, 2},

		// 图片分类模块路由
		GetCategoriesByAccountPath: {1, 2},
		SaveCategoryPath:           {1, 2},
		RemoveCategoryPath:         {1, 2},

		// 聊天室
		GetChatRoomsPath:    {1, 2},
		GetChatRoomByIdPath: {1, 2},
		CreateChatRoomPath:  {1, 2},
		WsChatRoomPath:      {1, 2},
		RemoveChatRoomPath:  {1, 2},
	}
)
